package com.anjubao.parking.municipal.parkinglot.model;

import com.anjubao.parking.municipal.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 支付订单记录表
 *
 * @author zhuchunfeng
 */
@Getter
@Setter
@Accessors(chain = true)
@Builder
@TableName("parking_trade_order")
@ApiModel(value="ParkingTradeOrder",description = "支付订单记录表")
public class ParkingTradeOrder extends BaseEntity<ParkingTradeOrder> {

    @TableId(type = IdType.INPUT)
    @TableField(value="out_trade_id")
    @ApiModelProperty(name="outTradeId",value = "交易订单ID")
    private Long outTradeId;

    @TableField(value="out_trade_no")
    @ApiModelProperty(name="outTradeNo",value = "商户订单号，交易订单ID 生成规则为300(3位)+yyMMddHHmm(10位)+out_trade_id(19位)")
    private String outTradeNo;

    @TableField(value="parking_record_id")
    @ApiModelProperty(name="parkingRecordId",value = "进出记录ID")
    private Long parkingRecordId;

    @TableField(value="remote_parking_record_id")
    @ApiModelProperty(name="remoteParkingRecordId",value = "接入车场进出记录ID")
    private String remoteParkingRecordId;

    @TableField(value="app_id")
    @ApiModelProperty(name="appId",value = "公众账号ID")
    private String appId;

    @TableField(value="mch_id")
    @ApiModelProperty(name="mchId",value = "商户号")
    private String mchId;

    @TableField(value="app_key")
    @ApiModelProperty(name="appKey",value = "App Key")
    private String appKey;

    @TableField(value="sub_mch_id")
    @ApiModelProperty(name="subMchId",value = "子商户号")
    private String subMchId;

    @TableField(value="pay_device_info")
    @ApiModelProperty(name="payDeviceInfo",value = "设备号")
    private String payDeviceInfo;

    @TableField(value="description")
    @ApiModelProperty(name="description",value = "订单描述；对应微信的body字段")
    private String description;

    @TableField(value="details")
    @ApiModelProperty(name="details",value = "商家订单详情")
    private String details;

    @TableField(value="attach")
    @ApiModelProperty(name="attach",value = "附加数据，在查询API和支付通知中原样返回，该字段主要用于商户携带订单的自定义数据")
    private String attach;

    @TableField(value="type")
    @ApiModelProperty(name="type",value = "订单类型 1:停车订单,2:充电订单")
    private Integer type;

    @TableField("business_id")
    private String businessId;

    @TableField(value="pay_fee")
    @ApiModelProperty(name="payFee",value = "订单实付金额")
    private Integer payFee;

    @TableField(value="total_fee")
    @ApiModelProperty(name="totalFee",value = "订单总金额")
    private Integer totalFee;

    @TableField(value="spbill_create_ip")
    @ApiModelProperty(name="spbillCreateIp",value = "用户端实际ip")
    private String spbillCreateIp;

    @TableField(value="time_start")
    @ApiModelProperty(name="timeStart",value = "订单生成时间")
    private LocalDateTime timeStart;

    @TableField(value="time_expire")
    @ApiModelProperty(name="timeExpire",value = "交易过期时间，订单失效时间")
    private LocalDateTime timeExpire;

    @TableField(value="goods_tag")
    @ApiModelProperty(name="goodsTag",value = "商品标记")
    private String goodsTag;

    @TableField(value="pay_type")
    @ApiModelProperty(name="payType",value = "交易类型,JSAPI，NATIVE，APP，对应微信的trade_type")
    private String payType;

    @TableField(value="product_id")
    @ApiModelProperty(name="productId",value = "商品ID，pay_type=NATIVE，此参数必传。此id为二维码中包含的商品ID，商户自行定义。")
    private String productId;

    @TableField(value="payer_openid")
    @ApiModelProperty(name="payerOpenid",value = "openID,pay_type=JSAPI，此参数必传，用户在商户appid下的唯一标识。")
    private String payerOpenid;

    @TableField(value="payer_phone")
    @ApiModelProperty(name="payerPhone",value = "用户标识，用户手机号")
    private String payerPhone;

    @TableField(value="payer_customer_id")
    @ApiModelProperty(name="payerCustomerId",value = "用户标识，用户id")
    private String payerCustomerId;

    @TableField(value="unsupported_pay_channel")
    @ApiModelProperty(name="unsupportedPayChannel",value = "指定支付方式，no_credit--指定不能使用信用卡支付")
    private String unsupportedPayChannel;

    @TableField(value="prepay_id")
    @ApiModelProperty(name="prepayId",value = "预支付交易会话标识")
    private String prepayId;

    @TableField(value="qrcode_url")
    @ApiModelProperty(name="qrcodeUrl",value = "二维码链接，pay_type为NATIVE是有返回，可将该参数值生成二维码展示出来进行扫码支付")
    private String qrcodeUrl;

    @TableField(value="pay_channel_id")
    @ApiModelProperty(name="payChannelId",value = "渠道ID -- 1：微信 2:支付宝 3:银联 4:现金 99:其他")
    private Integer payChannelId;

    @TableField(value="pay_channel_type")
    @ApiModelProperty(name="payChannelType",value = "渠道类型 1:平台支付 2:自助缴费机 3:线下收费 4:手持机收费 99:其他")
    private Integer payChannelType;

    @TableField(value="transaction_id")
    @ApiModelProperty(name="transactionId",value = "第三方支付平台订单号")
    private String transactionId;

    @TableField(value="status")
    @ApiModelProperty(name="status",value = "订单状态, 0：未支付，1：已支付，2：已关闭，3：已退款")
    private Integer status;

    @TableField(value="status_desc")
    @ApiModelProperty(name="statusDesc",value = "交易状态描述")
    private String statusDesc;

    @TableField(value="parking_trade_bill_status")
    @ApiModelProperty(name="parkingTradeBillStatus",value = "对账状态")
    private Integer parkingTradeBillStatus;

    @TableField(value="notify_url")
    @ApiModelProperty(name="notifyUrl",value = "订单回调通知url")
    private String notifyUrl;

    @TableField(value="remark")
    @ApiModelProperty(name="remark",value = "订单备注")
    private String remark;

    @TableField(value="revision")
    @ApiModelProperty(name="revision",value = "乐观锁")
    private Integer revision;

    @TableField(value="gen_type")
    @ApiModelProperty(name="genType",value = "生成方式 1:自动 2:APP")
    private Integer genType;

    @TableField(value="charging_type")
    @ApiModelProperty(name="chargingType",value = "计费方式 1:普通,2:月卡,3:年卡,4:免费")
    private Integer chargingType;

    @TableField(value="parking_lot_id")
    @ApiModelProperty(name="parkingLotId",value = "停车场ID")
    private Long parkingLotId;

    @TableField(value="parking_lot_code")
    @ApiModelProperty(name="parkingLotCode",value = "停车场编号,code生成规则为100(3位)+yyMMddHHmm(10位)+id(19位)")
    private String parkingLotCode;

    @TableField(value="parking_lot_name")
    @ApiModelProperty(name="parkingLotName",value = "停车场名称")
    private String parkingLotName;

    @TableField(value="plate_number")
    @ApiModelProperty(name="plateNumber",value = "车牌号码（车牌识别）")
    private String plateNumber;

    @TableField(value="parking_lot_slot_id")
    @ApiModelProperty(name="parkingLotSlotId",value = "停车场停车位ID")
    private Long parkingLotSlotId;

    @TableField(value="parking_lot_slot_code")
    @ApiModelProperty(name="parkingLotSlotCode",value = "停车场停车位编号")
    private String parkingLotSlotCode;

    @TableField(value="parking_lot_slot_name")
    @ApiModelProperty(name="parkingLotSlotName",value = "停车场停车位名称")
    private String parkingLotSlotName;

    @TableField(value="province_id")
    @ApiModelProperty(name="provinceId",value = "停车场所在省份ID")
    private Integer provinceId;

    @TableField(value="province_name")
    @ApiModelProperty(name="provinceName",value = "停车场所在省份名称")
    private String provinceName;

    @TableField(value="city_id")
    @ApiModelProperty(name="cityId",value = "停车场所在城市ID")
    private Integer cityId;

    @TableField(value="city_name")
    @ApiModelProperty(name="cityName",value = "停车场所在城市名称")
    private String cityName;

    @TableField(value="district_id")
    @ApiModelProperty(name="districtId",value = "停车场所在行政区ID")
    private Integer districtId;

    @TableField(value="district_name")
    @ApiModelProperty(name="districtName",value = "停车场所在行政区名称")
    private String districtName;

    @TableField(value="is_reserve")
    @ApiModelProperty(name="isReserve",value = "是否预约 0:不是,1:是")
    private Integer isReserve;

    @TableField(value="refused_reason")
    @ApiModelProperty(name="refusedReason",value = "拒收理由")
    private String refusedReason;

    @TableField(value="enter_pic_url")
    @ApiModelProperty(name="enterPicUrl",value = "进场截图")
    private String enterPicUrl;

    @TableField(value="out_pic_url")
    @ApiModelProperty(name="outPicUrl",value = "出场截图")
    private String outPicUrl;

    @TableField(value="enter_time")
    @ApiModelProperty(name="enterTime",value = "进入时间")
    private LocalDateTime enterTime;

    @TableField(value="out_time")
    @ApiModelProperty(name="outTime",value = "出场时间")
    private LocalDateTime outTime;

    @TableField(value="fulfill_time")
    @ApiModelProperty(name="fulfillTime",value = "订单完成时间")
    private LocalDateTime fulfillTime;


}